export interface CommandContext {
  args: string[];
  options: Record<string, any>;
  cwd: string;
  config: CLIConfig;
  logger: Logger;
}

export interface Command {
  name: string;
  description: string;
  aliases?: string[];
  options?: CommandOption[];
  arguments?: CommandArgument[];
  examples?: string[];
  execute(context: CommandContext): Promise<void>;
}

export interface CommandOption {
  name: string;
  description: string;
  type: 'string' | 'number' | 'boolean';
  required?: boolean;
  default?: any;
  choices?: string[];
}

export interface CommandArgument {
  name: string;
  description: string;
  required?: boolean;
  variadic?: boolean;
}

export interface Plugin {
  name: string;
  version: string;
  description: string;
  commands: Command[];
  install?(): Promise<void>;
  uninstall?(): Promise<void>;
  activate?(context: PluginContext): Promise<void>;
  deactivate?(): Promise<void>;
}

export interface PluginContext {
  registerCommand(command: Command): void;
  unregisterCommand(name: string): void;
  getConfig(): CLIConfig;
  getLogger(): Logger;
}

export interface CLIConfig {
  plugins: string[];
  logLevel: 'debug' | 'info' | 'warn' | 'error';
  theme: {
    primary: string;
    secondary: string;
    success: string;
    warning: string;
    error: string;
  };
  [key: string]: any;
}

export interface Logger {
  debug(message: string, ...args: any[]): void;
  info(message: string, ...args: any[]): void;
  warn(message: string, ...args: any[]): void;
  error(message: string, ...args: any[]): void;
  success(message: string, ...args: any[]): void;
  setLogLevel(level: 'debug' | 'info' | 'warn' | 'error'): void;
}

export interface SpinnerOptions {
  text: string;
  color?: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray';
  spinner?: string;
}

export interface NetworkRequestOptions {
  timeout?: number;
  retries?: number;
  retryDelay?: number;
  headers?: Record<string, string>;
}

export interface GitHubRepository {
  owner: string;
  repo: string;
  branch?: string;
  tag?: string;
  url: string;
}

export interface FileOperationOptions {
  overwrite?: boolean;
  createDirs?: boolean;
  backup?: boolean;
}
